using System;
using System.Windows;
using System.Windows.Controls.Primitives;

namespace SupremacyEditor
{
    public static class ComboBoxExtensions
    {
        #region Constructors and Finalizers
        static ComboBoxExtensions()
        {
            IsPopupResizeGripProperty = DependencyProperty.RegisterAttached(
                "IsPopupResizeGrip",
                typeof(bool),
                typeof(ComboBoxExtensions),
                new FrameworkPropertyMetadata(
                    false,
                    FrameworkPropertyMetadataOptions.None));

            IsPopupResizeGripProperty.AddOwner(typeof(Thumb));
        }
        #endregion

        #region IsPopupResizeGrip Attached Property
        public static readonly DependencyProperty IsPopupResizeGripProperty;

        public static bool GetIsPopupResizeGrip(Thumb source)
        {
            if (source == null)
                throw new ArgumentNullException("source");
            return (bool)source.GetValue(IsPopupResizeGripProperty);
        }

        public static void SetIsPopupResizeGrip(Thumb source, bool value)
        {
            if (source == null)
                throw new ArgumentNullException("source");
            source.SetValue(IsPopupResizeGripProperty, value);
        }
        #endregion
    }
}